package com;

import java.net.UnknownHostException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import lombok.extern.slf4j.Slf4j;

@SpringBootApplication
@EnableTransactionManagement //开启注解方式的事务管理
@Slf4j
@EnableCaching//开发缓存注解功能
@EnableScheduling //开启任务调度
@EnableAsync
public class thirteenClassicsApplication {

    public static void main(String[] args) throws UnknownHostException {
        long start = System.currentTimeMillis();
        ConfigurableApplicationContext context = SpringApplication.run(thirteenClassicsApplication.class, args);
        long end = System.currentTimeMillis();
        Environment env = context.getEnvironment();
        String port = env.getProperty("server.port");
        long startupTime = end - start;
        log.warn("Server started! Running on: {}", port);
        log.warn("Startup time: {}秒", startupTime / 1000);

    }

}